<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<ul class="nav">
    <li>榴莲</li>
    <li>臭豆腐</li>
    <li>鲱鱼馒头</li>
    <li>大猪蹄子</li>
</ul>

<script>
    // 闭包应用-3S之后, 打印所有li元素的内容
    var lis = document.querySelectorAll('li');


    setTimeout(() => {
        lis.forEach((value, key) => {
            console.log(value.innerHTML + key)
        })
    }, 3000);
</script>
</body>
</html>
